/*
 * FriendshipBoxResource.h
 *
 *  Created on: 2013. 9. 6.
 *      Author: mega@gamevil.com
 */

#ifndef FRIENDSHIPBOXRESOURCE_H_
#define FRIENDSHIPBOXRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class FriendshipBoxData
{
public:
	struct Flyweight
	{
		Toolkit::Str<50> _ITEM_NAME;
		int _SHEET_TYPE;
		int _REWARD_TID;
		int _COUNT;
		int _RATE;
	};

public:
	FriendshipBoxData() : _totalRate(0) {};
	virtual ~FriendshipBoxData();

	bool LoadResource(int company, int saleCode);

	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE & GetTree() { return _clsFlyTree; }
	int	GetTotalRate() { return _totalRate; }

private:
	void	Clear();

private:
	DATATREE	_clsFlyTree;
	int			_totalRate;
};


class FriendshipBoxResource
{
public:
	FriendshipBoxResource();
	virtual ~FriendshipBoxResource();

	bool LoadResource();
	FriendshipBoxData * GetFly(User * pUser);

private:
	FriendshipBoxData * pFriendshipBoxAndroid;
	FriendshipBoxData * pFriendshipBoxIOS;
};

} /* NResource */ } /* ProjectZ */

#endif /* FRIENDSHIPBOXRESOURCE_H_ */
